home *** CD-ROM | disk | FTP | other *** search
- global cwhite, cyellow, gport, playermode, name, identity, name2, lastip
-
- on startMovie
- set cwhite to the foreColor of line 1 of field "colors"
- set cyellow to the foreColor of line 2 of field "colors"
- reset()
- initnet()
- repeat with i = 1 to 6
- sound close i
- end repeat
- set the soundLevel to 0
- set the modal of getAt(the windowList, 1) to 1
- tell the stage
- pause()
- end tell
- end
-
- on stopMovie
- reset()
- XNetShutdown()
- put " " into field "ip"
- put " " into field "chat"
- put " " into field "name"
- end
-
- on openWindow
- repeat with i = 6 to 0
- set the soundLevel to i
- end repeat
- end
-
- on closeWindow
- set the soundLevel to 6
- if identity = 0 then
- tell the stage
- continue()
- forget(getAt(the windowList, 1))
- end tell
- else
- closebox()
- end if
- exit
- tell the stage
- go(8)
- continue()
- mainloop()
- end tell
- end
-
- on closebox
- set lastip to field "ip"
- repeat while not (field "chat" contains "with: ")
- onlineloop()
- end repeat
- repeat with i = 1 to the number of lines in field "chat"
- if line i of field "chat" contains "with: " then
- set yu to the itemDelimiter
- set the itemDelimiter to ":"
- set name2 to item 2 of line i of field "chat"
- set name2 to char 2 to length(name2) - 1 of name2
- set the itemDelimiter to yu
- exit repeat
- end if
- end repeat
- tell the stage
- forget(getAt(the windowList, 1))
- end tell
- if identity <> 0 then
- tell the stage
- go(115)
- end tell
- end if
- end
-
- on exitFrame
- onlineloop()
- end
-
- on idle
- onlineloop()
- end
-
- on reset
- put "0.0.0.0" into field "ip"
- end
-
- on addme n
- put RETURN after field "chat"
- set the foreColor of line the number of lines in field "chat" of field "chat" to cwhite
- put RETURN & "-Player " & identity & "-" & RETURN & n after field "chat"
- set the foreColor of line the number of lines in field "chat" of field "chat" to cwhite
- set the foreColor of line the number of lines in field "chat" - 1 of field "chat" to cwhite
- end
-
- on addother n
- puppetSound(1, 11)
- put RETURN after field "chat"
- set the foreColor of line the number of lines in field "chat" of field "chat" to cyellow
- set identityx to not (identity - 1) + 1
- put RETURN & "-Player " & identityx & "-" & RETURN & n after field "chat"
- set the foreColor of line the number of lines in field "chat" of field "chat" to cyellow
- set the foreColor of line the number of lines in field "chat" - 1 of field "chat" to cyellow
- end
-
- on send n
- global nn
- if the paramCount = 0 then
- set n to field "send"
- end if
- if char 1 of n <> "[" then
- addme(n)
- end if
- set nn to n
- put " " into field "send"
- senddata(string("addchat" && QUOTE & nn & QUOTE))
- end
-
- on doproc
- global gbuffer
- set yu3 to the itemDelimiter
- set the itemDelimiter to "|"
- repeat with i = 1 to the number of items in gbuffer
- do(string(item i of gbuffer))
- put string(item i of gbuffer)
- end repeat
- set gbuffer to EMPTY
- set the itemDelimiter to yu3
- end
-
- on addchat n
- addother(n)
- end
-